# help functions to get marks
# 
# Author: guochun
###############################################################################


get_marks=function(data.ppp,marks=c()){
	nmarks=length(marks)
	all_mark_names=colnames(marks(data.ppp))
	
	for(i in 1:nmarks){
		intre_mark_name=marks[i]
		intre_mark_col=match(intre_mark_name,all_mark_names)
		if(i==1)
			if(nmarks!=1)
				intre_marks=data.frame(intre_mark_name=marks(data.ppp)[,intre_mark_col])
	        else
				intre_marks=intre_mark_name=marks(data.ppp)[,intre_mark_col]
		else{
			temp=data.frame(intre_mark_name=marks(data.ppp)[,intre_mark_col])
			intre_marks=cbind(intre_marks,temp)
		}
	}
	if(is.data.frame(intre_marks))
		colnames(intre_marks)=marks
	return(intre_marks)
}
